import { configureStore } from '@reduxjs/toolkit';
import userSlice from './slices/userSlice';
import dashboardSlice from './slices/dashboardSlice';
import authSlice from './slices/authSlice';

// 配置 Redux store
export const store = configureStore({
  reducer: {
    user: userSlice,
    dashboard: dashboardSlice,
    auth: authSlice,
  },
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware({
      serializableCheck: {
        ignoredActions: ['persist/PERSIST'],
      },
    }),
  // 启用 Redux DevTools
  devTools: import.meta.env.MODE !== 'production',
});

// 导出 RootState 和 AppDispatch 类型
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch; 